From 3483f006f3396f96a4f2cc0289a84bff075a968a Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Tue, 8 Nov 2005 14:53:27 +0100 Subject: [PATCH] Fix two leaks in the pyxc interface. The dictionaries are being added to lists, and an extra ref was being left behind. Signed-off-by: Sean Perry Signed-off-by: Robert Read --- tools/python/xen/lowlevel/xc/xc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index f7a00037e9..e2585dc5ed 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -342,6 +342,7 @@ static PyObject *pyxc_domain_getinfo(PyObject *self, "ssidref", info[i].ssidref, "shutdown_reason", info[i].shutdown_reason); PyDict_SetItemString(info_dict, "handle", pyhandle); + Py_DECREF(pyhandle); PyList_SetItem(list, i, info_dict); } @@ -388,7 +389,7 @@ static PyObject *pyxc_vcpu_getinfo(PyObject *self, cpumap >>= 1; } PyDict_SetItemString(info_dict, "cpumap", cpulist); - + Py_DECREF(cpulist); return info_dict; } -- 2.30.2